This resource endpoint retrieves a given query roleset.
A successful call to the endpoint will return status code 200 (OK), and the response body will contain the requested information. A status code of 401 (Unauthorized) is returned if the user does not have the necessary privileges for this action. A response code of 404 (Not Found) indicates that no such query roleset exists.
Produces | |
---|---|
application/xml | XML Content |
application/json | JSON Content |
text/html | HTML Web Content |
manage-user
role, or the following privilege:
http://marklogic.com/xdmp/privileges/manage
This resource endpoint retrieves a given query roleset.
> curl -X GET --anyauth -u admin:admin -H "Content-Type:application/xml" http://localhost:8002/manage/v2/query-rolesets/
Output:
<?xml version="1.0" encoding="UTF-8"?> <query-roleset-default-list xsi:schemaLocation="http://marklogic.com/manage/security manage-security.xsd" xmlns="http://marklogic.com/manage/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <meta> <uri>/manage/v2/query-rolesets/</uri> <current-time>2017-05-02T02:05:22.3820159-07:00</current-time> <elapsed-time units="sec">0.0112146</elapsed-time> </meta> <list-items> <list-count units="quantity">0</list-count> </list-items> <relations> <relation-group array="true"> <typeref>security-database</typeref> <relation-count units="quantity">1</relation-count> <relation array="true"> <uriref>/manage/v2/databases/Security</uriref> <roleref>database</roleref> <idref>7161534863501463199</idref> </relation> </relation-group> </relations> </query-roleset-default-list>
This is the XML output for GET.
> curl -X GET --anyauth -u admin:admin -H "Content-Type:application/json" http://localhost:8002/manage/v2/query-rolesets/
Output:
{ "query-roleset-default-list":{ "meta":{ "uri":"/manage/v2/query-rolesets/", "current-time":"2017-05-02T02:05:22.3847221-07:00", "elapsed-time":{ "units":"sec", "value":0.0095739} } , "list-items":{ "list-count":{ "units":"quantity", "value":0} } , "relations":{ "relation-group":{ "typeref":"security-database", "relation-count":{ "units":"quantity", "value":1} , "relation":{ "uriref":"/manage/v2/databases/Security", "roleref":"database", "idref":"7161534863501463199", "nameref":"Security"} } } , "related-views":{ "related-view":[ { "view-type":"root", "view-name":"default", "view-uri":"/manage/v2"} ] } } }
This is the JSON output for GET.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.